//
//  HotspotView.m
//  sandbox
//
//  Created by 杨岑 on 12/25/14.
//  Copyright (c) 2014 杨岑. All rights reserved.
//

#import "HotspotView.h"
#import "NSImage+Etched.h"


@implementation HotspotView

- (void)drawRect:(NSRect)dirtyRect {
    [super drawRect:dirtyRect];
    
    [self.image drawEtchedInRect:self.bounds];
}

- (void)updateTrackingAreas
{
    for (NSTrackingArea* a in self.trackingAreas)
    {
        [self removeTrackingArea:a];
    }
    
    [self addTrackingRect:self.bounds owner:self userData:nil assumeInside:YES];
}

- (void)mouseUp:(NSEvent *)theEvent
{
    [self sendAction:self.action to:self.target];
}

- (void)scrollWheel:(NSEvent *)theEvent
{
    NSLog(@"%@: %@", self, theEvent);
}

@end
